//
//  ImageIdModel.swift
//  Employee
//
//  Created by swordjoy on 2017/4/12.
//  Copyright © 2017年 remotevillage. All rights reserved.
//

import Foundation
import SwiftyJSON

struct ImageIdModel: ModelProtocol {

  let headImage: String
  let fileId: String
  
  init(json: JSON) {
    self.headImage = json["headImage"].stringValue
    self.fileId = json["fileId"].stringValue
  }
  
  static func array(from jsonArray: [JSON]) -> [ImageIdModel] {
    return jsonArray.map({ return ImageIdModel(json: $0) })
  }
}

struct FlowImage: ModelProtocol {
  
  let filePath: String
  let fileId: String
  
  init(json: JSON) {
    self.filePath = json["filePath"].stringValue
    self.fileId = json["fileId"].stringValue
  }
  
  static func array(from jsonArray: [JSON]) -> [FlowImage] {
    return jsonArray.map({ return FlowImage(json: $0) })
  }
}

struct NewImageModel: ModelProtocol {
    
    let accessUrl: String
    let fileId: String
    let thumbImageURL: String
    
    init(json: JSON) {
        self.accessUrl = json["accessUrl"].stringValue
        self.fileId = json["fileId"].stringValue
        self.thumbImageURL = json["thumbImageURL"].stringValue
    }
    
    static func array(from jsonArray: [JSON]) -> [NewImageModel] {
        return jsonArray.map({ return NewImageModel(json: $0) })
    }
}
